package com.sqx.modules.health.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author gxy
 * @since 2022-08-12
 */
@Getter
@Setter
  @TableName("ncg_app_order")
@ApiModel(value = "AppOrder对象", description = "")
public class AppOrder implements Serializable {

    private static final long serialVersionUID = 1L;
      @TableId(value = "id")
      @JsonSerialize(using = ToStringSerializer.class)
      private Long id;

      @ApiModelProperty("序列号")
      private String orderno;

      @ApiModelProperty("订单类型：1-购买;2-租赁")
      private String type;

      @ApiModelProperty("商品id，多产品逗号分割")
      private String productid;

      @ApiModelProperty("订单名称 单产品默认产品名; 多产品：查看详情页面")
      private String name;

      @ApiModelProperty("用户id")
      private Integer uid;

      @ApiModelProperty("用户名字")
      private String uname;

      @ApiModelProperty("联系方式")
      private String phone;

      @ApiModelProperty("支付时间")
//      private LocalDateTime paytime;
      @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")                    // 表示返回时间类型
      @JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss", timezone = "GMT+8")      // 表示接收时间类型
      private LocalDateTime paytime;

      @ApiModelProperty("订单状态0-待支付; 1-已支付;2-已领取; 3-已归还;4-退还申请;4-退款中;5-已退款中;6-已经评价")
      private Integer status;

      @ApiModelProperty("1有效 0 无效")
      private String enable;

      @ApiModelProperty("是否被删除")
      private String isdelete;

      @ApiModelProperty("金额总计")
      private BigDecimal cost;

      @ApiModelProperty("押金合计")
      private BigDecimal deposit;

      @ApiModelProperty("折扣")
      private BigDecimal discount;

      @ApiModelProperty("使用天数，当type=2为租赁时候有值")
      private Integer useday;

      @ApiModelProperty("配送地址")
      private String address;

      @ApiModelProperty("确认人")
      private String confirm;

      @ApiModelProperty("1-院内;2-院外 如果院内hid和ageid需要有值,如果院外仅仅ageid有值")
      private String position;

      @ApiModelProperty("医院id")
      private Long hid;

      @ApiModelProperty("代理人id")
      private Integer agentid;

      @ApiModelProperty("删除时间")
      private LocalDateTime delettime;

      @ApiModelProperty("创建时间")
//      private LocalDateTime createtime;
      @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")                    // 表示返回时间类型
      @JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss", timezone = "GMT+8")      // 表示接收时间类型
      private String createtime;

      @ApiModelProperty("领取时间")
      @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")                    // 表示返回时间类型
      @JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss", timezone = "GMT+8")      // 表示接收时间类型
      private String receivetime;

      @ApiModelProperty("归还时间")
      @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")                    // 表示返回时间类型
      @JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss", timezone = "GMT+8")      // 表示接收时间类型
      private String returntime;

      @ApiModelProperty("类型对应的名称")
      @TableField(exist = false)
      private String typeName;

      @ApiModelProperty("状态对应的名称")
      @TableField(exist = false)
      private String statusName;

      @ApiModelProperty("商品简介")
      @TableField(exist = false)
      private String productInfo;

      @ApiModelProperty("商品缩略图")
      @TableField(exist = false)
      private String productIcon;

      @ApiModelProperty("设备编码")
      private String imei;

}
